#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
using namespace std;

int pow(int x) {
	int p = 3;
	if (x == 0) return 1;
	for (int i = 1; i < x; i++) {
		p *= 3;
	}
	return p;
}
int main() {
	int n;
	cin >> n;
	for (int i = 0; i <= n; i++) {
		printf("pow(3,%d) = %2d\n", i, pow(i));
	}
	return 0;
}